package com.example.boot.controller;

import com.example.boot.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @GetMapping("/hehe")
    public String test(){
        System.out.println("true = " + true);
        return "hehe";
    }
    @Autowired
    private RedisTemplate redisTemplate;
    @GetMapping("/redis/test")
    public String getRedisTest(){
        Long increment = redisTemplate.opsForValue().increment(1);
        return "返回后的值"+increment;
    }

    @Autowired
    Person person;

    @GetMapping("/getPropertiesTest")
    public Person getPerson(){
        return person;
    }


}
